package top.zuli.package02.homework06;

import java.util.Scanner;

public class Demo5 {
    int i;
    int mul = 1;
    void print(int n){
        if (i< n){
            i++;
            mul *= i;
            print(n);
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个整数：");
        int n = scanner.nextInt();
        Demo5 demo = new Demo5();
        demo.print(n);
        System.out.print(n+"的阶乘结果为："+demo.mul);
    }
}
